/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canteen.sys.view;

import canteen.sys.model.generic.HibernateDAOFactory;
import org.hibernate.Session;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;

/**
 *
 * @author TNT
 */
public class ReportAccount extends javax.swing.JInternalFrame {

    HibernateDAOFactory hibernateDAOFactory = HibernateDAOFactory.getInstance();

    /**
     * Creates new form ReportAccount
     */
    public ReportAccount() throws Exception {
        initComponents();
//        this.add(gen());
        this.pack();
        SessionFactoryImplementor sfi = (SessionFactoryImplementor) hibernateDAOFactory.getCurrentSession().getSessionFactory();
        ConnectionProvider cp = sfi.getConnectionProvider();
        

    }

//    public final JRViewer gen() throws Exception {
//        InputStream in = this.getClass().getResourceAsStream("/canteen/sys/view/resource/Account.jrxml");
//        JasperReport jasperReport = JasperCompileManager.compileReport(in);
//        Map params = new HashMap();
//        List<LoginMaster> list = new ArrayList<LoginMaster>();
//        list.add(new User("ajaxswing"));
//        JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(list);
//        JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, 
//                HibernateDAOFactory.getInstance().getCurrentSession().g);
//        return new JRViewer(jasperPrint);
//    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 552, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 453, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
